<!-- BEGIN PAGE HEADER-->
<?php $this->load->view('partials/breadcrumb.tpl') ?>
<!-- END PAGE HEADER-->
<style>
    .ECalendarBox {
        z-index: 100;
    }

    .ECalendarBox .currentdate h2 {
        margin-top: 0px;
    }

    .modal-dialog {
        width: 1180px;
    }

    .image_contain {
        background: rgba(12, 12, 12, 0.2);
        padding: 6px;
        text-align: center;
    }
</style>
<link href="<?= image_url('/static/assets/global/css/ecalendar-style.css') ?>" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="<?= image_url('/static/js/Ecalendar.jquery.min.js') ?>"></script>

<div class="col-md-12">
    <?= form_open('', Array('class' => 'form-horizontal form-bordered', 'role' => 'form', 'id' => 'form_edit', 'data-category-id' => $obj->id)) ?>
    <div class="col-md-6">
        <div class="portlet box green">
            <?= edit_form_caption('测评主体信息') ?>
            <div class="portlet-body form">
                <input type="hidden" id="update_time" name="update_time" value="<?= set_value('update_time', $obj->update_time) ?>"/>
                <div class="form-body col-lg-12">
                    <?= edit_form_static('接单者', $obj->operator_id ? $allReviewsAdmin[$obj->operator_id] : $allReviewsAdmin[$this->_user->id]) ?>
                    <?php if ($obj->operator_id): ?>
                        <input type="hidden" name="operator_id" value="<?= $obj->operator_id ?>"/>
                    <?php else: ?>
                        <input type="hidden" name="operator_id" value="<?= $this->_user->id ?>"/>
                    <?php endif; ?>
                    <?= edit_form_input('task_id', set_value('task_id', $obj->task_id), '任务ID', 'readonly="readonly"') ?>
                    <?= edit_form_static('asin', $obj->asin) ?>
                    <?= edit_form_input('order_no', set_value('order_no', $obj->order_no), '买手下单号') ?>
                    <?= edit_form_input('comment_link', set_value('comment_link', $obj->comment_link), '评论链接') ?>
                    <?= edit_form_input('true_product_price', set_value('true_product_price', ($obj->true_product_price > 0) ? (number_format($obj->true_product_price, 2, '.', '')) : ''), '购买时商品价格', '', 1) ?>
                    <?= edit_form_input('buyer_pay_total', set_value('buyer_pay_total', ($obj->buyer_pay_total > 0) ? (number_format($obj->buyer_pay_total, 2, '.', '')) : ''), '买家实付的钱数', '', 1) ?>
                    <?= edit_form_dropdown('buyer_pay_coin_type', array('' => '选择币种') + IOSS_StaticConfig::getcoinTypeInfo(), set_value('buyer_pay_coin_type', $obj->buyer_pay_coin_type), '买家下单的币种', 'id="buy_select"') ?>
                    <?= edit_form_input('buyer_order_time', set_value('buyer_order_time', $obj->buyer_order_time > 0 ? date('Y/m/d', $obj->buyer_order_time) : ''), '买家下单时间', 'id="buyer_order_time" autoComplete="off"') ?>
                    <?= edit_form_input('buyer_pay_time', set_value('buyer_pay_time', $obj->buyer_pay_time > 0 ? date('Y/m/d', $obj->buyer_pay_time) : ''), '买家付款时间', 'id="buyer_pay_time" autoComplete="off"') ?>

                    <?= edit_form_input('review_time', set_value('review_time', $obj->review_time > 0 ? date('Y/m/d', $obj->review_time) : ''), '留评日期', 'id="review_time" autoComplete="off"') ?>

                    <?= edit_form_dropdown('ceping_type', [0 => '未标记', 1 => '销量', 2 => '测评'], set_value('ceping_type', $obj->ceping_type), '测评类型') ?>
                    <?= edit_form_textarea('remark', set_value('remark', $obj->remark), '备注信息','id="remark"') ?>
                    <?php if ($obj->add_image):?>
                        <input type="hidden" id="add_image">
                        <div class="form-group">
                            <div class="col-xs-3">凭证图1</div>
                            <div class="col-xs-7">
                                <input type="hidden" name="add_image" value="<?= $obj->add_image ?>">
                                <div class="image_contain">
                                    <img class="img-rounded" style="width: 100%;height: auto" src="<?= image_url($obj->add_image) ?>" alt="">
                                </div>
                            </div>
                        </div>
                    <?php else: ?>
                        <div class="form-group">
                            <label class="col-xs-3 control-label">凭证图1</label>
                            <div class="col-xs-7">
                                <input type="text" class="form-control" placeholder="在此处粘贴图片" id="add_image">
                                <input type="hidden" name="add_image">
                            </div>
                            <br>
                        </div>
                        <div class="form-group">
                            <div class="col-xs-3"></div>
                            <div class="col-xs-7">
                                <div class="image_contain" id="image"></div>
                            </div>
                        </div>
                    <?php endif; ?>

                    <?php if ($obj->add_image_1):?>
                        <input type="hidden" id="add_image_1">
                        <label class="col-xs-3 control-label">凭证图2</label>
                        <div class="form-group">
                            <div class="col-xs-3"></div>
                            <div class="col-xs-7">
                                <input type="hidden" name="add_image" value="<?= $obj->add_image_1 ?>">
                                <div class="image_contain">
                                    <img class="img-rounded" style="width: 100%;height: auto" src="<?= image_url($obj->add_image_1) ?>" alt="">
                                </div>
                            </div>
                        </div>
                    <?php else: ?>
                        <div class="form-group">
                            <label class="col-xs-3 control-label">凭证图2</label>
                            <div class="col-xs-7">
                                <input type="text" class="form-control" placeholder="在此处粘贴图片" id="add_image_1">
                                <input type="hidden" name="add_image_1">
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-xs-3"></div>
                            <div class="col-xs-7">
                                <div class="image_contain" id="image_1"></div>
                            </div>
                        </div>
                    <?php endif; ?>
                </div>
                <script>
                    $(document).ready(function () {
                        $('.img-rounded').zoomify();
                    });
                    (function(){
                        var imgReader = function (item) {
                            var blob = item.getAsFile(),
                                reader = new FileReader();

                            reader.onload = function (e) {
                                var img = '<img style="width:100%" src="' + e.target.result + '">';
                                $("input[name='add_image']").val(e.target.result);
                                $('#image').html(img);
                            };

                            reader.readAsDataURL(blob);
                        };
                        var imgReader1 = function (item) {
                            var blob = item.getAsFile(),
                                reader = new FileReader();

                            reader.onload = function (e) {
                                var img = '<img style="width:100%" src="' + e.target.result + '">';
                                $("input[name='add_image_1']").val(e.target.result);
                                $('#image_1').html(img);
                            };

                            reader.readAsDataURL(blob);
                        };

                        document.getElementById('add_image').addEventListener('paste', function (e) {
                            var clipboardData = e.clipboardData,
                                i = 0,
                                items, item, types;
                            if (clipboardData) {
                                items = clipboardData.items;
                                if (!items) {
                                    return;
                                }
                                item = items[0];
                                types = clipboardData.types || [];
                                for (; i < types.length; i++) {
                                    if (types[i] === 'Files') {
                                        item = items[i];
                                        break;
                                    }
                                }
                                if (item && item.kind === 'file' && item.type.match(/^image\//i)) {
                                    imgReader(item);
                                }
                            }
                        });
                        document.getElementById('add_image_1').addEventListener('paste', function (e) {
                            var clipboardData = e.clipboardData,
                                i = 0,
                                items, item, types;
                            if (clipboardData) {
                                items = clipboardData.items;
                                if (!items) {
                                    return;
                                }
                                item = items[0];
                                types = clipboardData.types || [];
                                for (; i < types.length; i++) {
                                    if (types[i] === 'Files') {
                                        item = items[i];
                                        break;
                                    }
                                }
                                if (item && item.kind === 'file' && item.type.match(/^image\//i)) {
                                    imgReader1(item);
                                }
                            }
                        });
                    })();

                    $('#buy_select').change(function () {
                        $('#pay_select').val($(this).val());
                    });

                    function getCount() {
                        var pre_value = $("input[name='true_company_cost']").val() * $("input[name='true_company_cost_rate']").val();
                        $("input[name='true_shuadan_amount']").val(pre_value.toFixed(3))
                    }
                </script>

            </div>
        </div>
    </div>
    <div class="col-md-6">
        <div class="portlet box blue">
            <?= edit_form_caption('测评应付款项信息') ?>
            <div class="portlet-body form">
                <div class="form-body col-lg-12">
                    <!--货款-->
                    <table class="table table-hover table-bordered table-striped">
                        <thead>
                        <tr><th colspan="4">应付货款信息（有则填，无则全留空）<span style="color:red;" class="tips_1"></span></th></tr>
                        </thead>
                        <tbody>
                        <tr>
                            <td>收款人姓名</td>
                            <td colspan="3"><input type="text" name="contact_1" style="width: 100%;"/></td>
                        </tr>
                        <tr>
                            <td>收款账号</td>
                            <td colspan="3"><input type="text" name="pay_account_1" style="width: 100%;"/></td>
                        </tr>
                        <tr>
                            <td>开户行</td>
                            <td colspan="3"><input type="text" name="bank_1" style="width: 100%;"/></td>
                        </tr>
                        <tr>
                            <td>付款金额</td>
                            <td><input name="amount_1" type="number" step="any"/></td>
                            <td>付款方式</td>
                            <td><select name="pay_method_1">
                                    <?php foreach(IOSS_StaticConfig::getPayMethod() as $k=>$v):?>
                                        <option value="<?=$k;?>"><?=$v;?></option>
                                    <?php endforeach;?>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <td>币种</td>
                            <td><select name="coin_type_1">
                                    <?php foreach(IOSS_StaticConfig::getcoinTypeInfo() as $k=>$v):?>
                                        <option value="<?=$k;?>"><?=$v;?></option>
                                    <?php endforeach;?>
                                </select>
                            </td>
                            <td>对RMB汇率</td>
                            <td><input name="rate_rmb_1" type="number" step="any"/></td>
                        </tr>
                        <tr>
                            <td>备注</td>
                            <td colspan="3"><textarea name="remark_1" id="remark_1" style="width: 100%;"></textarea></td>
                        </tr>
                        </tbody>
                    </table>
                    <!--佣金-->
                    <table class="table table-hover table-bordered table-striped">
                        <thead>
                        <tr><th colspan="4">应付买手佣金信息（有则填，无则全留空）<span style="color:red;" class="tips_2"></span></th></tr>
                        </thead>
                        <tbody>
                        <tr>
                            <td>收款人姓名</td>
                            <td colspan="3"><input type="text" name="contact_2" style="width: 100%;"/></td>
                        </tr>
                        <tr>
                            <td>收款账号</td>
                            <td colspan="3"><input type="text" name="pay_account_2" style="width: 100%;"/></td>
                        </tr>
                        <tr>
                            <td>开户行</td>
                            <td colspan="3"><input type="text" name="bank_2" style="width: 100%;"/></td>
                        </tr>
                        <tr>
                            <td>付款金额</td>
                            <td><input name="amount_2" type="number" step="any"/></td>
                            <td>付款方式</td>
                            <td><select name="pay_method_2">
                                    <?php foreach(IOSS_StaticConfig::getPayMethod() as $k=>$v):?>
                                        <option value="<?=$k;?>"><?=$v;?></option>
                                    <?php endforeach;?>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <td>币种</td>
                            <td><select name="coin_type_2">
                                    <?php foreach(IOSS_StaticConfig::getcoinTypeInfo() as $k=>$v):?>
                                        <option value="<?=$k;?>"><?=$v;?></option>
                                    <?php endforeach;?>
                                </select>
                            </td>
                            <td>对RMB汇率</td>
                            <td><input name="rate_rmb_2" type="number" step="any"/></td>
                        </tr>
                        <tr>
                            <td>备注</td>
                            <td colspan="3"><textarea name="remark_2" id="remark_2" style="width: 100%;"></textarea></td>
                        </tr>
                        </tbody>
                    </table>
                    <!--中介费-->
                    <table class="table table-hover table-bordered table-striped">
                        <thead>
                        <tr><th colspan="4">应付中介佣金信息（有则填，无则全留空）<span style="color:red;" class="tips_3"></span></th></tr>
                        </thead>
                        <tbody>
                        <tr>
                            <td>收款人姓名</td>
                            <td colspan="3"><input type="text" name="contact_3" style="width: 100%;"/></td>
                        </tr>
                        <tr>
                            <td>收款账号</td>
                            <td colspan="3"><input type="text" name="pay_account_3" style="width: 100%;"/></td>
                        </tr>
                        <tr>
                            <td>开户行</td>
                            <td colspan="3"><input type="text" name="bank_3" style="width: 100%;"/></td>
                        </tr>
                        <tr>
                            <td>付款金额</td>
                            <td><input name="amount_3" type="number" step="any"/></td>
                            <td>付款方式</td>
                            <td><select name="pay_method_3">
                                    <?php foreach(IOSS_StaticConfig::getPayMethod() as $k=>$v):?>
                                        <option value="<?=$k;?>"><?=$v;?></option>
                                    <?php endforeach;?>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <td>币种</td>
                            <td><select name="coin_type_3">
                                    <?php foreach(IOSS_StaticConfig::getcoinTypeInfo() as $k=>$v):?>
                                        <option value="<?=$k;?>"><?=$v;?></option>
                                    <?php endforeach;?>
                                </select>
                            </td>
                            <td>对RMB汇率</td>
                            <td><input name="rate_rmb_3" type="number" step="any"/></td>
                        </tr>
                        <tr>
                            <td>备注</td>
                            <td colspan="3"><textarea name="remark_3" id="remark_3" style="width: 100%;"></textarea></td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>

    </div>
    <script>
        $('#buy_select').change(function () {
            $('#pay_select').val($(this).val());
        })
    </script>
    <?php $this->load->view('partials/submitButtons.tpl') ?>
    <?= form_close() ?>
</div>
<!-- END PAGE CONTENT-->
<link href="<?= image_url('/static/assets/global/plugins/jstree/dist/themes/default/style.min.css') ?>"
      rel="stylesheet"
      type="text/css"/>

<script type="text/javascript">
    $(document).ready(function () {
        $("#buyer_order_time").ECalendar({
            type: "date",   //模式，time: 带时间选择; date: 不带时间选择;
            stamp: false,   //是否转成时间戳，默认true;
            offset: [0, 2],   //弹框手动偏移量;
            format: "yyyy/mm/dd",   //时间格式 默认 yyyy-mm-dd hh:ii;
            skin: 5,   //皮肤颜色，默认随机，可选值：0-8,或者直接标注颜色值;
            step: 10,   //选择时间分钟的精确度;
            callback: function (v, e) {
            } //回调函数
        });
        $("#buyer_pay_time").ECalendar({
            type: "date",   //模式，time: 带时间选择; date: 不带时间选择;
            stamp: false,   //是否转成时间戳，默认true;
            offset: [0, 2],   //弹框手动偏移量;
            format: "yyyy/mm/dd",   //时间格式 默认 yyyy-mm-dd hh:ii;
            skin: 2,   //皮肤颜色，默认随机，可选值：0-8,或者直接标注颜色值;
            step: 10,   //选择时间分钟的精确度;
            callback: function (v, e) {
            } //回调函数

        });
        $("#review_time").ECalendar({
            type: "date",   //模式，time: 带时间选择; date: 不带时间选择;
            stamp: false,   //是否转成时间戳，默认true;
            offset: [0, 2],   //弹框手动偏移量;
            format: "yyyy/mm/dd",   //时间格式 默认 yyyy-mm-dd hh:ii;
            skin: 2,   //皮肤颜色，默认随机，可选值：0-8,或者直接标注颜色值;
            step: 10,   //选择时间分钟的精确度;
            callback: function (v, e) {
            } //回调函数

        });

        AjaxUploader.uploadTempUrl = "<?=site_url('/common/AjaxUpload/upload') . '/'  ?>";
        AjaxUploader.init();

        //处理页面js
        (function () {
            var task_id = '<?php echo $obj->task_id?>';   //当前任务id
            var order_no = $('input[name="order_no"]'); //买家下单号
            var comment_link = $('input[name="comment_link"]'); //评论链接
            var true_product_price = $('input[name="true_product_price"]'); //购买时商品价格
            var buyer_pay_total = $('input[name="buyer_pay_total"]'); //买家实付钱数
            var buyer_pay_coin_type = $('select[name="buyer_pay_coin_type"]');  //买家下单的币种
            var buyer_order_time_text = $('#buyer_order_time'); //买家下单时间
            var buyer_order_time_hide = $('input[name="buyer_order_time"]'); //买家下单时间
            var buyer_pay_time_text = $('#buyer_pay_time'); //买家付款时间
            var buyer_pay_time_hide = $('input[name="buyer_pay_time"]'); //买家付款时间
            var review_time_text = $('#review_time'); //留评时间
            var review_time_hide = $('input[name="review_time"]'); //留评时间
            var ceping_type = $('select[name="ceping_type"]');  //测评类型
            var remark = $('#remark'); //备注信息

            //在Jquery里格式化Date日期时间数据
            var timeStamp2String =function(time){
                if(!time){
                    return '';
                }
                var datetime = new Date();
                datetime.setTime(time+'000');
                var year = datetime.getFullYear();
                var month = datetime.getMonth() + 1 < 10 ? "0" + (datetime.getMonth() + 1) : datetime.getMonth() + 1;
                var date = datetime.getDate() < 10 ? "0" + datetime.getDate() : datetime.getDate();
                return year + "/" + month + "/" + date;
            }

            var setRecord = function(record){
                $(comment_link).val(record.comment_link);
                $(true_product_price).val(parseFloat(record.true_product_price).toFixed(2));
                $(buyer_pay_total).val(parseFloat(record.buyer_pay_total).toFixed(2));
                $(buyer_pay_coin_type).val(record.buyer_pay_coin_type);
                $(buyer_order_time_text).val(timeStamp2String(record.buyer_order_time));
                $(buyer_order_time_hide).val(timeStamp2String(record.buyer_order_time));
                $(buyer_pay_time_text).val(timeStamp2String(record.buyer_pay_time));
                $(buyer_pay_time_hide).val(timeStamp2String(record.buyer_pay_time));
                $(review_time_text).val(timeStamp2String(record.review_time));
                $(review_time_hide).val(timeStamp2String(record.review_time));
                $(ceping_type).val(record.ceping_type);
                $(remark).val(record.remark);
                if(record.add_image){
                    $('#image').html('<img src="/'+record.add_image+'" style="width:100%;"/>');
                }
                if(record.add_image_1){
                    $('#image_1').html('<img src="/'+record.add_image_1+'" style="width:100%;"/>');
                }
            };

            //款项状态
            var getStatus = function(status){
                switch (parseInt(status)){
                    case 0:
                        return '待提交财务';
                        break;
                    case 1:
                        return '财务待处理';
                        break;
                    case 2:
                        return '财务标定异常';
                        break;
                    case 3:
                        return '财务打款完成';
                        break;
                }
            };

            //设置款项数据
            var setRecordItems = function(items){
                $.each(items,function(i,item){
                    console.log(getStatus(item.status));
                    var suffix = item.payment_type;
                    var tips_elm = $('.tips_'+suffix);
                    var contact_elm = $('input[name="contact_'+suffix+'"]');
                    var pay_account_elm = $('input[name="pay_account_'+suffix+'"]');
                    var bank_elm = $('input[name="bank_'+suffix+'"]');
                    var amount_elm = $('input[name="amount_'+suffix+'"]');
                    var pay_method_elm = $('select[name="pay_method_'+suffix+'"]');
                    var coin_type_elm = $('select[name="coin_type_'+suffix+'"]');
                    var rate_rmb_elm = $('input[name="rate_rmb_'+suffix+'"]');
                    var remark_elm = $('#remark_'+suffix);

                    $(tips_elm).text(getStatus(item.status));
                    $(contact_elm).val(item.contact);
                    $(pay_account_elm).val(item.pay_account);
                    $(bank_elm).val(item.bank);
                    $(amount_elm).val(item.amount);
                    $(pay_method_elm).val(item.pay_method);
                    $(coin_type_elm).val(item.coin_type);
                    if(item.rate_rmb > 0){
                        $(rate_rmb_elm).val(item.rate_rmb);
                    }else{
                        $(rate_rmb_elm).val('');
                    }
                    $(remark_elm).val(item.remark);


                    if(item.status == '3' || item.status == '1'){
                        $(contact_elm).attr("disabled", "disabled");
                        $(pay_account_elm).attr("disabled", "disabled");
                        $(bank_elm).attr("disabled", "disabled");
                        $(amount_elm).attr("disabled", "disabled");
                        $(pay_method_elm).attr("disabled", "disabled");
                        $(coin_type_elm).attr("disabled", "disabled");
                        $(rate_rmb_elm).attr("disabled", "disabled");
                    }else{
                        $(contact_elm).attr("disabled", false);
                        $(pay_account_elm).attr("disabled", false);
                        $(amount_elm).attr("disabled", false);
                        $(pay_method_elm).attr("disabled", false);
                        $(coin_type_elm).attr("disabled", false);
                        $(rate_rmb_elm).attr("disabled", false);
                    }

                });
            }

            //订单输入后，请求后台是否已有相关项目记录，有的话，填充进来
            $(order_no).blur(function () {
                $.post('<?=site_url("/tasks/taskrecords/ajaxReturnByTaskIdAndOrderNo")?>', {
                    task_id: task_id,
                    order_no: $.trim($(order_no).val()),
                    asin: '<?=$obj->asin;?>'
                }, function (ret) {
                    var retObj = $.parseJSON(ret);
                    console.log(retObj);
                    var recordInfo = retObj.recordInfo;
                    var itemInfos = retObj.itemInfos;

                    if(recordInfo){
                        setRecord(recordInfo);
                    }
                    if(itemInfos && itemInfos.length > 0){
                        setRecordItems(itemInfos);
                    }

                });
            });


            //监听表单提交验证
            $('#form_edit').submit(function () {
                var validation = true;
                var amount_1 = $("input[name='amount_1']");
                var amount_2 = $("input[name='amount_2']");
                var amount_3 = $("input[name='amount_3']");

                var order_no = $("input[name='order_no']");
                if($.trim($(order_no).val()).length == 0){
                    validation = false;
                    alert('买手下单号不能为空！');
                    $(order_no).focus();
                    return false;
                }
                //货款
                if ($.trim($(amount_1).val()).length > 0) {
                    var pay_account_1 = $("input[name='pay_account_1']");
                    var coin_type_1 = $("select[name='coin_type_1']");
                    var pay_method_1 = $("select[name='pay_method_1']");
                    if ($.trim($(pay_account_1).val()).length == 0) {
                        validation = false;
                        alert('货款-付款账号不能为空！');
                        $(pay_account_1).focus();
                    } else if ($.trim($(coin_type_1).val()).length == 0) {
                        validation = false;
                        alert('货款-币种不能为空！');
                        $(coin_type_1).focus();
                    } else if ($.trim($(pay_method_1).val()).length == 0) {
                        validation = false;
                        alert('货款-付款方式不能为空！');
                        $(pay_method_1).focus();
                    }
                    if(validation == false){
                        return false;
                    }
                }

                if ($.trim($(amount_2).val()).length > 0) { //佣金
                    var pay_account_2 = $("input[name='pay_account_2']");
                    var coin_type_2 = $("select[name='coin_type_2']");
                    var pay_method_2 = $("select[name='pay_method_2']");
                    if ($.trim($(pay_account_2).val()).length == 0) {
                        validation = false;
                        alert('佣金-付款账号不能为空！');
                        $(pay_account_2).focus();
                    } else if ($.trim($(coin_type_2).val()).length == 0) {
                        validation = false;
                        alert('佣金-币种不能为空！');
                        $(coin_type_2).focus();
                    } else if ($.trim($(pay_method_2).val()).length == 0) {
                        validation = false;
                        alert('佣金-付款方式不能为空！');
                        $(pay_method_2).focus();
                    }
                    if(validation == false){
                        return false;
                    }
                }

                if ($.trim($(amount_3).val()).length > 0) { //中介佣金
                    var pay_account_3 = $("input[name='pay_account_3']");
                    var coin_type_3 = $("select[name='coin_type_3']");
                    var pay_method_3 = $("select[name='pay_method_3']");
                    if ($.trim($(pay_account_3).val()).length == 0) {
                        validation = false;
                        alert('中介佣金-付款账号不能为空！');
                        $(pay_account_3).focus();
                    } else if ($.trim($(coin_type_3).val()).length == 0) {
                        validation = false;
                        alert('中介佣金-币种不能为空！');
                        $(coin_type_3).focus();
                    } else if ($.trim($(pay_method_3).val()).length == 0) {
                        validation = false;
                        alert('中介佣金-付款方式不能为空！');
                        $(pay_method_3).focus();
                    }
                    if(validation == false){
                        return false;
                    }
                }
                return validation;
            });
        })();
    });
</script>
